package com.ruoyi.common.entity;


import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

@Data
public class AiModelEntity {

    public enum Level {
        NormalChat(1),
        AdvanceChat(2),
        Token(3),
        Draw(4);

        private int code;

        Level(int code) {
            this.code = code;
        }

        public int getCode() {
            return this.code;
        }
    }

    public static Level toLevel(int levelId) {
        for (Level level : Level.values()) {
            if (level.getCode() == levelId) {
                return level;
            }
        }
        return null;
    }

    private int id;

    private String name;

    private String showName;

    private int platformId;

    private int state;

    private Level level;

    private int levelId;

    private String path;

    private String remark;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date createTime;


    private String platformName;

    private AiPlatformEntity platformEntity;


    public static final int STATE_NORMAL = 1;
    public static final int STATE_DISABLED = 2;

    public static final String PATH_CHAT_GPT = "/v1/chat/completions";
}
